home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / SpriteFight 2002 v2.0a1 / SpriteForeground.c < prev    next >
Text File  |  1996-04-19  |  1KB  |  60 lines

  1. /*******************************************************
  2. *** SpriteForeground.c
  3. *** By: Stefan C. Sinclair
  4. *** Copyright © 1996 All Rights Reserved Worldwide.
  5. *** Brief description here
  6. *******************************************************/
  7.  
  8. #include "SpriteForeground.h"
  9.  
  10. extern CWindowPtr    gWindowP;
  11. extern short    gFrameAdvanceTime;
  12. extern RgnHandle gWorkRgn;
  13.  
  14. // CreateForegroundSprite
  15. OSErr CreateForegroundSprite(void *spriteStorageP, short foregroundSpriteID)
  16. {
  17.     SpritePtr    tempSpriteP;
  18.     short    firstPICTID, firstMaskID, numFrames;
  19.     OSErr    err;
  20.     
  21.     switch(foregroundSpriteID)
  22.     {
  23.         case kBagLadySpriteID:
  24.             firstPICTID = kBagLadyPICTID;
  25.             firstMaskID = kBagLadyMaskPICTID;
  26.             numFrames = 4;
  27.             break;
  28.         case kWheelChairSpriteID:
  29.             firstPICTID = kWheelChairPICTID;
  30.             firstMaskID = kWheelChairMaskPICTID;
  31.             numFrames = 4;
  32.             break;
  33.         default:
  34.             firstPICTID = kBagLadyPICTID;
  35.             firstMaskID = kBagLadyMaskPICTID;
  36.             numFrames = 4;
  37.             break;
  38.     }
  39.     
  40.     err = SWCreateSpriteFromPictResource(&tempSpriteP,spriteStorageP,
  41.             firstPICTID,  firstMaskID,numFrames,kRegionMask);
  42.     return err;
  43. }
  44.  
  45. void SetupForegroundSprite(SpritePtr spriteP, short foregroundSpriteID)
  46. {
  47.     switch(foregroundSpriteID)
  48.     {
  49.         case kBagLadySpriteID:
  50.             SetupBagLadySprite(spriteP);
  51.             break;
  52.         case kWheelChairSpriteID:
  53.             SetupWheelChairSprite(spriteP);
  54.             break;
  55.         default:
  56.             SetupBagLadySprite(spriteP);
  57.             break;
  58.     }
  59. }
  60.